home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / prog / pas_all.zip / TI425.ASC < prev    next >
Text File  |  1991-09-11  |  2KB  |  67 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  TURBO PASCAL GRAPHIX TOOLBOX           NUMBER  :  425
  9.   VERSION  :  4.0
  10.        OS  :  PC-DOS
  11.      DATE  :  APRIL 5, 1988                            PAGE  :  1/1
  12.  
  13.     TITLE  :  MODIFYING HERCPRESENT IN GRAPHIX TOOLBOX 4.0
  14.  
  15.  
  16.  
  17.  
  18.   Turbo  Pascal  stores  function results in a special area. In the
  19.   case of a Boolean  function  result, it is stored in BP-0001. The
  20.   exit code of a function then moves the value stored there to AL.
  21.  
  22.   The code presented in function  HercPresent  computes  the proper
  23.   value for the function result,  but never places it into BP-0001,
  24.   and just keeps the value in AL. On some machines, this  can cause
  25.   a range check error  on  assignment  of  the function result. The
  26.   following patch adds the  inline  code to the end of the function
  27.   to move the result into BP-0001. After that, the exit  code moves
  28.   the value back into AL and the function terminates.
  29.  
  30.  
  31.   The  old  inline  statement of the Function  HercPresent  was  as
  32.   follows:
  33.  
  34.            $26/$88/$0E/$FF/$3F/  {          MOV       ES:[3FFFH],CL
  35.   }
  36.            $C3/                                    {            RET
  37.   }
  38.            $30/$C0);                        { L4:  XOR        AL,AL
  39.   }
  40.                                  {                              L7:
  41.   }
  42.  
  43.   end; { HercPresent }
  44.  
  45.   Adding the three inline commands  ( /$88/$46/$FF ) before the end
  46.   of  the inline statement places the value in  AL  into  the  area
  47.   where Turbo will look for the function result.
  48.  
  49.   The new code should look as follows:
  50.  
  51.            $26/$88/$0E/$FF/$3F/  {          MOV       ES:[3FFFH],CL
  52.   }
  53.            $C3/                                    {            RET
  54.   }
  55.            $30/$C0/                      {  L4:    XOR        AL,AL
  56.   }
  57.            $88/$46/$FF);           {  L7:    MOV       [BP-0001],AL
  58.   }
  59.  
  60.   end; { HercPresent }
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.